//
//  FLTableView.m
//  BaseRepo
//
//  Created by leo on 2018/8/8.
//  Copyright © 2018年 LEO. All rights reserved.
//

#import "FLTableView.h"

@implementation FLTableView

+ (FLTableView *(^)(UITableViewStyle))fl_initWithTableViewStyle {
    return ^(UITableViewStyle style){
        FLTableView *tabelView = [[FLTableView alloc]initWithFrame:CGRectZero style:style];
        tabelView.estimatedRowHeight = 0;
        tabelView.estimatedSectionHeaderHeight = 0;
        tabelView.estimatedSectionFooterHeight = 0;
        return tabelView;
    };
}

-(FLTableView *(^)(CGRect))fl_frame {
    return ^(CGRect frame){
        self.frame = frame;
        return self;
    };
}


- (FLTableView *(^)(id<UITableViewDelegate>))fl_delegate {
    return ^(id<UITableViewDelegate> delegate) {
        self.delegate = delegate;
        return self;
    };
}

- (FLTableView *(^)(id<UITableViewDataSource>))fl_dataSource {
    return ^(id<UITableViewDataSource> dataSource) {
        self.dataSource = dataSource;
        return self;
    };
}

- (FLTableView *(^)(__unsafe_unretained Class, NSString *))fl_registerClassWithIdentifierForReuse {
    return ^(__unsafe_unretained Class aClass, NSString *identity){
        [self registerClass:aClass forCellReuseIdentifier:identity];
        return self;
    };
}


-(FLTableView *(^)(UIColor *))fl_backgroundColor {
    return ^(UIColor *color){
        self.backgroundColor = color;
        return self;
    };
}

- (FLTableView *(^)(CGFloat))fl_rowHeight {
    return ^(CGFloat rowH){
        self.rowHeight = rowH;
        return self;
    };
}

@end
